import request from '@/utils/request'

// 获取所有省份
export function getProvinces() {
  return request({
    url: '/system/region/api/provinces',
    method: 'get'
  })
}

// 根据省ID获取城市列表
export function getCitiesByProvinceId(provinceId) {
  return request({
    url: '/system/region/api/cities/' + provinceId,
    method: 'get'
  })
}

// 根据市ID获取县区列表
export function getDistrictsByCityId(cityId) {
  return request({
    url: '/system/region/api/districts/' + cityId,
    method: 'get'
  })
}

// 获取地区树形数据
export function getRegionTree() {
  return request({
    url: '/system/region/api/tree',
    method: 'get'
  })
}